/*
day193
2020.3.8
*/
#include<iostream>
#include<string>
using namespace std;

class Solution {
public:
    bool isLongPressedName(string &name, string &typed) {
    	if(name.size()>typed.size())
    	{
    		return false;
		}
		int j=0;
		for(int i=0;i<typed.size();++i)
		{
			if(typed[i]==name[j])
			{
				++j;
			}
			if(j==name.size())
			{
				return true;
			}
		}
		return false;
    }
};

int main()
{
	Solution s;
	string name = "saeed", typed = "ssaaedd";
	cout<<s.isLongPressedName(name,typed)<<endl;
	return 0;
}
